﻿
(function ($) {
	$.fn.validationEngineLanguage = function () { };
	$.validationEngineLanguage = {
		newLang: function () {
			$.validationEngineLanguage.allRules = { 
				"required": {    			// Add your regex rules here, you can take telephone as an example
					"regex": "none",
					"alertText": "* 此项目必填",
					"alertTextCheckboxMultiple": "* 请选择一个选项",
					"alertTextCheckboxe": "* 必须选中"
				},
				"length": {
					"regex": "none",
					"alertText": "* 长度在 ",
					"alertText2": " 到 ",
					"alertText3": " 个字符之间"
				},
				"maxCheckbox": {
					"regex": "none",
					"alertText": "* 选择的选项超出"
				},
				"minCheckbox": {
					"regex": "none",
					"alertText": "* 请选择不超过 ",
					"alertText2": " 个选项"
				},
				"confirm": {
					"regex": "none",
					"alertText": "* 输入内容不匹配"
				},
				"telephone": {
					"regex": "/^[0-9\-\(\)\ ]+$/",
					"alertText": "* 无效电话号码"
				},
				"mobile": {
					"regex": "/^(13|15|18)[0-9]{9}$/",
					"alertText": "* 无效手机号码"
				},
				"email": {
					"regex": "/^[a-zA-Z0-9_\.\-]+\@([a-zA-Z0-9\-]+\.)+[a-zA-Z0-9]{2,4}$/",
					"alertText": "* 无效邮件地址"
				},
				"date": {
					"regex": "/^[0-9]{4}\-\[0-9]{1,2}\-\[0-9]{1,2}$/",
					"alertText": "* 无效日期，格式必须是 YYYY-MM-DD "
				},
				"onlyNumber": {
					"regex": "/^[0-9\ ]+$/",
					"alertText": "* 只允许录入数字"
				},
				"noSpecialCaracters": {
					"regex": "/^[0-9a-zA-Z]+$/",
					"alertText": "* 只允许输入字母和数字"
				},
				"ajaxUser": {
					"file": "CheckLogin.ashx",
					"extraData": "",
					"alertTextOk": "* 用户名可以使用",
					"alertTextLoad": "* Loading, please wait",
					"alertText": "* 用户名已经被使用"
				},
				"onlyLetter": {
					"regex": "/^[a-zA-Z\ \']+$/",
					"alertText": "* 只允许输入字母"
				}
			}

		}
	}
})(jQuery);

$(document).ready(function () {
	$.validationEngineLanguage.newLang()
});